<?php

namespace AppBundle\DataFixtures\ORM;

use \Doctrine\Common\DataFixtures\AbstractFixture;
use \Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use \Doctrine\Common\Persistence\ObjectManager;
use \Doctrine\Bundle\FixturesBundle\Fixture;
use AppBundle\Entity\Category as Category;

class LoadCategoryData extends Fixture
{
    /**
     *
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        //Create a common product
        $pub1=new Category();
        $pub1->setName('Common');
        $this->addReference('commonPub', $pub1);

        //Create a special product
        $pub2=new Category();
        $pub2->setName('Special');
        $this->addReference('specialPub', $pub2);

        $manager->persist($pub1);
        $manager->persist($pub2);

        $manager->flush();
    }

    /**
     *
     * {@inheritDoc}
     */
    public function getOrder()
    {
       return 1;
    }
}